package demo.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import demo.common.Result;
import demo.entity.University;
import demo.entity.Universitymajor;
import demo.entity.Universitymajor2;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;


public interface LimitmajorMapper extends BaseMapper<Universitymajor> {
  @Select("select u1.unname,m.mname \n" +
    "\tfrom university_major as `u2` left join major as `m` on u2.major = m.mcode left join university as `u1` on u2.university = u1.number\n" +
    "    left join second_choice as `s` on u2.second_choice = s.scid left join first_choice as `f` on u2.first_choice = f.fcid")
//    Page<Universitymajor2> findmajor(Page<Universitymajor2> page,@PathVariable String unname);
    //这个是可以查询的，但没关键词
//  Page<Universitymajor2> findmajor(Page<Universitymajor2> page);
  Page<Universitymajor2> findmajor(Page<Universitymajor2> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<University> queryWrapper);

}

